Repository navigation
Add CURLINFO_SIZE_DELIVERED and the size_delivered key to curl_getinfo() return types - #6683
Merged
Merged
Conversation
…o() return types Closes phpstan/phpstan#15371
VincentLanglet
approved these changes
Oct 9, 2026
There was a problem hiding this comment.
🟢 Approval recommended
The implementation matches PHP 8.6 behavior and includes focused regression coverage.
0 open findings
What changed in this PR
Adds PHP 8.6 support for CURLINFO_SIZE_DELIVERED in curl_getinfo() type inference.
Changes:
- Maps the new option to
int|false. - Adds
size_delivered: intto the full return array. - Adds direct-option and array-shape coverage.
| File | Description |
|---|---|
src/Type/Php/CurlGetinfoFunctionDynamicReturnTypeExtension.php |
Adds new option and array-key types. |
tests/PHPStan/Analyser/nsrt/curl_getinfo.php |
Updates the expected full array shape. |
tests/PHPStan/Analyser/nsrt/curl_getinfo_8.6.php |
Tests the PHP 8.6 constant. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
|
thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes phpstan/phpstan#15371
PHP 8.6 adds
CURLINFO_SIZE_DELIVEREDand asize_deliveredkey to the array returned bycurl_getinfo()(php/php-src@fd8eaaf15, libcurl >= 8.20.0).CURLINFO_SIZE_DELIVEREDreturnsint|false, like the other options that need a recent libcurl (CURLINFO_POSTTRANSFER_TIME_T,CURLINFO_CONN_ID), following the convention from Updatecurl_getinfo()return types #4279.size_delivered: intis added right aftersize_download, in the order php-src fills the array. Likeconn_idorused_proxy, it is not gated on the PHP version.